<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
		 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
		 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<parent>
		<groupId>xyz.paragon</groupId>
		<artifactId>paragon</artifactId>
		<version>0.1-SNAPSHOT</version>
	</parent>
	
	<artifactId>auth-service</artifactId>
	<version>0.1-SNAPSHOT</version>
	<name>auth-service</name>
	<description>Authentication service based on embedded Keycloak instance.</description>

	<properties>
		<keycloak.version>11.0.3</keycloak.version>
		<!-- At the current keycloak version its codebase is only compatible with Resteasy 3.x. -->
		<resteasy.version>3.13.2.Final</resteasy.version>
		<!-- Spring boot and Keycloak use different versions of infinispan, and you
		have to manually override its version in properties to use the one shipped with Keycloak -->
		<infinispan.version>10.1.8.Final</infinispan.version>
	</properties>

	<dependencies>

		<!-- cloud -->

		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-starter-config</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
		</dependency>

		<!-- web -->

		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
		</dependency>

		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-actuator</artifactId>
		</dependency>

		<!-- persistence -->

		<dependency>
	    	<groupId>org.springframework.boot</groupId>
	    	<artifactId>spring-boot-starter-data-jpa</artifactId>
		</dependency>

		<dependency>
	    	<groupId>com.h2database</groupId>
	    	<artifactId>h2</artifactId>
	    	<scope>runtime</scope>
		</dependency>

		<!-- Keycloak server -->

        <dependency>
            <groupId>org.keycloak</groupId>
            <artifactId>keycloak-dependencies-server-all</artifactId>
            <version>${keycloak.version}</version>
            <type>pom</type>
			<!-- We need to exclude slf4j on keycloak, since it's already shipped with Spring Boot -->
			<exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-log4j12</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>log4j</groupId>
                    <artifactId>log4j</artifactId>
                </exclusion>
            </exclusions>
		</dependency>

		<dependency>
            <groupId>org.jboss.resteasy</groupId>
            <artifactId>resteasy-jackson2-provider</artifactId>
            <version>${resteasy.version}</version>
        </dependency>

		<!-- config properties processor -->

		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-configuration-processor</artifactId>
			<optional>true</optional>
		</dependency>

		<!-- test -->

		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-test</artifactId>
			<scope>test</scope>
		</dependency>

		<!-- Exclude the jersey 1.x that comes with spring-cloud-starter-netflix-eureka-client,
			since we already have jersey 2.x from keycloak dependencies -->
		<dependency>
			<groupId>javax.ws.rs</groupId>
			<artifactId>jsr311-api</artifactId>
			<version>1.1.1</version>
			<scope>provided</scope>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
			</plugin>
		</plugins>
	</build>

</project>
